import React,{PureComponent} from 'react'
import {View,Image,StyleSheet,TouchableOpacity,TextInput,Text,Dimensions,Button,Platform} from 'react-native'
import MineAddressScene from "../../page/mine/address/MineAddressScene";

const {width} = Dimensions.get('window')

type Props = {
    navigation:any,
    address:Object,
    onPress:Function,
}

export default class OrderAddressView extends PureComponent<Props>{


    render(){
        const {address} = this.props
        var receiver = address ? address.receiver : '请填写收货人'
        var mobile = address ? address.mobile : '请填写联系电话'
        var addressde = address ? address.address : '请填写具体地址'

        return (
            <View style={{backgroundColor:'white',flex:1}}>
                <View style={{flexDirection:'row',alignItems:'center',marginTop:15,marginBottom:10,marginLeft:12,}}>
                    <Text style={styles.big_title}>讲义派送地址</Text>
                    <View style={{flex:1}}/>
                    <TouchableOpacity onPress={()=>{this.props.onPress()}} style={{flexDirection:'row',height:19,borderWidth:1,borderRadius:3,borderColor:'#B0B0B0',alignItems:'center',marginRight:20}}>
                        <Image style={{width:9,height:10,marginLeft:5, marginRight:2}} source={require('../../../res/img/detail/order_edit.png')}/>
                        <Text style={{fontSize:12,color:'#202020',fontWeight:'200',marginRight:4}}>修改</Text>
                    </TouchableOpacity>
                </View>
               <View style={styles.title_view}>
                    <Text style={styles.title_show}>收货人：</Text>
                   <Text style={styles.title_data}>{receiver}</Text>
               </View>
                <View style={styles.title_view}>
                    <Text style={styles.title_show}>联系电话：</Text>
                    <Text style={styles.title_data}>{mobile}</Text>
                </View>
                <View style={styles.title_view_address}>
                    <Text style={styles.title_show}>具体地址：</Text>
                    <Text numberOfLines={1} style={styles.title_data1}>{addressde}</Text>
                </View>
                <View style={{flexDirection:'row',backgroundColor:'rgba(0,0,0,0.1)',width:(width),height:1,marginTop:5}}/>
            </View>
        )
    }
}
const styles = StyleSheet.create({
    big_title : {
      fontWeight:'bold',
      fontSize:16,
      color:'black',

    },
    title_show:{
      color:'rgba(0,0,0,0.5)',
        fontWeight:'200',
        fontSize:12,
        width:64,
    },
    title_data:{
        color:'black',
        fontSize:13,
        marginLeft:8,
        width:200,
    },
    title_data1:{
        color:'black',
        fontSize:13,
        marginLeft:8,
        width:(width - 40 - 24 - 70),
    },
    title_view:{
        flexDirection:'row',
        backgroundColor:'white',
        marginBottom:8,
        alignItems:'center',
        marginLeft:20,
    },
    title_view_address:{
        flexDirection:'row',
        backgroundColor:'white',
        marginBottom:10,
        // alignItems:'center',
        marginLeft:20,
    },

})